
;; Test to see that list-function$ works!


(deffunction test-something ()
  ;; ----------------------------------------------------------------------
  (printout t ">>> Multiplication" crlf)
  (printout t (* 3 4) " ")
  (printout t (* 3.0 4) " ")
  (printout t (* -3.0 4.0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> Addition" crlf)
  (printout t (+ 3 4) " ")
  (printout t (+ 3.0 4) " ")
  (printout t (+ -3.0 4.0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> Subtraction" crlf)
  (printout t (- 4 3) " ")
  (printout t (- 4. 3) " ")
  (printout t (- -3.0 4.0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> Division" crlf)
  (printout t (/ 10 2) " ")
  (printout t (/ 10. 3) " ")
  (printout t (/ 9. 3) " ")
  (printout t (/ 0 1) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> less-than" crlf)
  (printout t (< 10 2) " ")
  (printout t (< 2 10) " ")
  (printout t (< 10. 20) " ")
  (printout t (< 9. 3) " ")
  (printout t (< -1. 0) " ")
  (printout t (< 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> lte" crlf)
  (printout t (<= 10 2) " ")
  (printout t (<= 2 10) " ")
  (printout t (<= 10. 10) " ")
  (printout t (<= 9. 10) " ")
  (printout t (<= -1. 0) " ")
  (printout t (<= 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> not-equal" crlf)
  (printout t (<> 10 2) " ")
  (printout t (<> 2 10) " ")
  (printout t (<> 10. 10) " ")
  (printout t (<> 9. 10) " ")
  (printout t (<> -1. 0) " ")
  (printout t (<> 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> equal" crlf)
  (printout t (= 10 2) " ")
  (printout t (= 2 10) " ")
  (printout t (= 10. 10) " ")
  (printout t (= 9. 10) " ")
  (printout t (= -1. 0) " ")
  (printout t (= 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> greater-than" crlf)
  (printout t (> 10 2) " ")
  (printout t (> 2 10) " ")
  (printout t (> 10. 10) " ")
  (printout t (> 9. 10) " ")
  (printout t (> -1. 0) " ")
  (printout t (> 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> gte" crlf)
  (printout t (>= 10 2) " ")
  (printout t (>= 2 10) " ")
  (printout t (>= 10. 10) " ")
  (printout t (>= 9. 10) " ")
  (printout t (>= -1. 0) " ")
  (printout t (>= 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> power" crlf)
  (printout t (** 10 2) " ")
  (printout t (** 2 10) " ")
  (printout t (** 10. 2) " ")
  (printout t (** 9. 1) " ")
  (printout t (** -1. 0) " ")
  (printout t (** 0.01 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> eq" crlf)
  (printout t (eq 10 10) " ")
  (printout t (eq a "a") " ")
  (printout t (eq a a) " ")
  (printout t (eq a A) " ")
  (printout t (eq a 3) " ")
  (printout t (eq "a" "a") " ")
  (printout t (eq 1 1.) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> neq" crlf)
  (printout t (neq 10 10) " ")
  (printout t (neq a "a") " ")
  (printout t (neq a a) " ")
  (printout t (neq a A) " ")
  (printout t (neq a 3) " ")
  (printout t (neq "a" "a") " ")
  (printout t (neq 1 1.) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> eq*" crlf)
  (printout t (eq* 10 10) " ")
  (printout t (eq* a "a") " ")
  (printout t (eq* a a) " ")
  (printout t (eq* a A) " ")
  (printout t (eq* a 3) " ")
  (printout t (eq* "a" "a") " ")
  (printout t (eq* 1 1.) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> abs" crlf)
  (printout t (abs 0) " ")
  (printout t (abs 1) " ")
  (printout t (abs 1.) " ")
  (printout t (abs -1.) " ")
  (printout t (abs -1) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> e" crlf)
  (printout t (e) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> pi" crlf)
  (printout t (pi) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> div" crlf)
  (printout t (div 10 3) " ")
  (printout t (div 10. 3) " ")
  (printout t (div 10 2) " ")
  (printout t (div 10 1) " ")
  (printout t (div 1 3) " ")
  (printout t (div -1 3) " ")
  (printout t (div -10. 3) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> mod" crlf)
  (printout t (mod 10 3) " ")
  (printout t (mod 10. 3) " ")
  (printout t (mod 10 2) " ")
  (printout t (mod 10 1) " ")
  (printout t (mod 1 3) " ")
  (printout t (mod -1 3) " ")
  (printout t (mod -10. 3) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> min" crlf)
  (printout t (min 1 2 3) " ")
  (printout t (min 1. 2 3.) " ")
  (printout t (min -1. 0 1) " ")
  (printout t (min 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> max" crlf)
  (printout t (max 1 2 3) " ")
  (printout t (max 1. 2 3.) " ")
  (printout t (max -1. 0 1) " ")
  (printout t (max 0 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> round" crlf)
  (printout t (round 1.4) " ")
  (printout t (round 1.5) " ")
  (printout t (round 1.6) " ")
  (printout t (round 0.0) " ")
  (printout t (round -1) " ")
  (printout t (round -1.6) " ")
  (printout t (round .99) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> sqrt" crlf)
  (printout t (sqrt 2) " ")
  (printout t (sqrt 2.0) " ")
  (printout t (sqrt 4) " ")
  (printout t (sqrt 4.0) " ")
  (printout t (sqrt -1) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> exp" crlf)
  (printout t (exp 1) " ")
  (printout t (exp 2) " ")
  (printout t (exp 3) " ")
  (printout t (exp -1) " ")
  (printout t (exp -1.) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> log" crlf)
  (printout t (log 10) " ")
  (printout t (log (e)) " ")
  (printout t (log -1) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> log10" crlf)
  (printout t (log10 10) " ")
  (printout t (log10 100) " ")
  (printout t (log10 1) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> float" crlf)
  (printout t (float 10) " ")
  (printout t (float -10.0) " ")
  (printout t (float 0) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> integer" crlf)
  (printout t (integer 1.5) " ")
  (printout t (integer 1.9) " ")
  (printout t (integer -1.9) crlf)
  ;; ----------------------------------------------------------------------
  (printout t ">>> random" crlf)
  (bind ?x (random))
  (bind ?y (random))
  (bind ?z (random))
  (printout t (eq ?x ?y) " ")
  (printout t (eq ?x ?z) " ")
  (printout t (eq ?y ?z) " ")
  (printout t (integerp ?x) " ")
  (printout t (floatp ?y) crlf)
)


(printout t "Testing operators:" crlf)
(test-something)
(printout t "Test done." crlf)
(exit)    